<?php

/**
 * Helper para formataçoes
 *
 * @author Aquiles B da Silva
 */
class Zend_Aquiles_Helpers_Mensagens extends Zend_View_Helper_Abstract {

    public function mensagens() {
        return $this;
    }

    public function getMensagens() {
        $html = '';
        if (isset($this->erros)) {
            $html .= '<div id="rola"></div><div class="alert alert-error">
                    <ul>';
                        foreach ($this->erros as $keyErro => $erro){
                            $html .= '<li class="'. $keyErro.'">'. $erro .'</li>';
                        }
                   ' </ul>
                </div>
                <div class="alert alert-success hidden-desktop"><ul></ul></div>';
        } else {
            $html.='<div id="rola"></div><div class="alert alert-error hidden-desktop"><ul></ul></div>';
            if (isset($this->msg)) {
                $html.='<div class="alert alert-success">
                        <ul>';
                foreach ($this->msg as $keyMsg => $msg) {
                    $html.=' <li class="'. $keyMsg.'">'.$msg .'</li>';
                }
                $html.='</ul></div>';
            }
        }
        
        echo $html;
    }

}